var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (im.isQuestFinished(32359)) {
        im.playerMessage(-1, "好像没什么作用");
        im.dispose();
        return
    }
    if (im.getServerName().equals("BMS单机") && im.getServerName().equals("BMS至尊体验服") && !im.getServerName().equals("BMS至尊")) {
        im.playerMessage(1, " 使用环境异常，请还原服务端配置。");
        im.dispose();
        return
    }
    if (status == 0 && d == 0) {
        im.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        im.dispose()
    } else {
        if (status === a++) {
            im.curNodeEventEnd(true);
            im.setInGameDirectionMode(true, true, false);
            im.fieldEffect_PlayFieldSound("advStory/stoneUse", 100);
            im.fieldEffect_ScreenMsg("demonSlayer/whiteOut");
            im.inGameDirectionEvent_AskAnswerTime(1950)
        } else {
            if (status === a++) {
                im.dispose();
                im.warp(1130020, 0, false);
                im.forceCompleteQuest(32358);
                im.gainExp(500000);
                im.inGameDirectionEvent_ForcedFlip15(700, 0, 0, 0, 0);
                im.setInGameDirectionMode(false, true, false);
                im.gainItem(2431820, -1)
            }
        }
    }
};